#!/usr/bin/env python3
# -*- coding=utf-8 -*-
# 题目：输入某年某月某日，判断这一天是这一年的第几天？

def f1():
    year = int(input("请输入年："))
    month = int(input("请输入月："))
    day = int(input("请输入日："))
    y = []
    # 闰年
    if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
        y = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30]
    # 平年
    else:
        y = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30]
    r = 0
    for x in range(month-1):
        r += y[x]
    r += day
    print(f"{year}年{month}月{day}日是第{r}天。")


f = f1
if __name__ == "__main__":
    f()
